package indi.zhifa.recipe.bailan5.busy.feign;

import indi.zhifa.recipe.bailan.framework.common.entity.dto.RestResponse;
import io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker;
import io.github.resilience4j.timelimiter.annotation.TimeLimiter;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigInteger;

@FeignClient(value = "tools",fallback = MathFeignHystrix.class)
@CircuitBreaker(name = "tools")
public interface IMathFeignCaller {
    @GetMapping("api/math/fibonacii/{n}")
    RestResponse<BigInteger> fibonacii(@PathVariable(name = "n") int n);

    @GetMapping("api/math/a_plus_b")
    RestResponse<Double> aPlusB(@RequestParam(name = "a") double a, @RequestParam(name = "b") double b);

    @GetMapping("api/math/timeout/{t}")
    RestResponse<String> timeoutTest(@PathVariable(name = "t") int t);
}
